import { http } from './request/http';

//
export const userLoginApi = (params) =>
  http.post( '/user/wx_login', { ...params });

//
export const getUserInfoApi = (params, config) =>
  http.get( '/user/info', { ...params }, config);
//
export const getCartListApi = (params) =>
  http.get( '/shopping_cart/page_list', { ...params });

export const updateCartApi = (params) =>
  http.post( '/shopping_cart/update', { ...params });

export const createOrderByCart = (params) =>
  http.post( '/order/create_by_shopping_cart', { ...params });

export const createOrderByProduct = (params) =>
  http.post( '/order/create_by_product', { ...params });

export const getOrderListApi = (params) =>
  http.get( '/order/page_list', { ...params });

export const getOrderDetailApi = (params) =>
  http.get( '/order/detail', { ...params });




export const getAddressListApi = (params) =>
  http.get( '/express_info/list_all', { ...params });

export const delAddressApi = (params) =>
  http.post( '/express_info/delete?id='+ params.id);

export const updateAddressApi = (params) =>
  http.post( '/express_info/update', { ...params });
export const addAddressApi = (params) =>
  http.post( '/express_info/add', { ...params });


export const userPointCountApi = () =>
  http.get( '/user_credit/left_amount');
export const userPointDetailApi = () =>
  http.get( '/user_credit/his_list');
export const userBonusCountApi = () =>
  http.get( '/user_bonus/left_amount');
export const userBonusDetailApi = () =>
  http.get( '/user_bonus/his_list');
export const userWithdrawMyStatisticsApi = () =>
  http.get( '/user_withdraw/my_statistics');

export const userBonusStatisticsApi = () =>
  http.get( '/bonus_pool/statistics');

export const userWithdrawLastReceiverInfoApi = () =>
  http.get( '/user_withdraw/last_receiver_info');
export const userWithdrawApplyApi = (params) =>
  http.post( '/user_withdraw/apply', {...params});


export const userWithdrawListApi =  (params) =>
  http.get( '/user_withdraw/page_list', {...params});
export const userWithdrawMyListApi =  (params) =>
  http.get( '/user_withdraw/my_his_records', {...params});